<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>上传简历</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            background: #f5f7fa;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        }
        .container {
            max-width: 700px;
            margin: 120px auto;
            background: #fff;
            border-radius: 24px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.10);
            padding: 60px 48px 48px 48px;
        }
        h2 {
            text-align: center;
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 30px;
        }
        .form-group {
            margin-bottom: 22px;
        }
        label {
            display: block;
            margin-bottom: 8px;
            color: #666;
            font-weight: 500;
        }
        input[type="file"] {
            width: 100%;
            padding: 12px;
            border-radius: 12px;
            border: 1px solid #e0e0e0;
            background: #f5f7fa;
        }
        .btn {
            width: 100%;
            background: #0071e3;
            color: #fff;
            border: none;
            padding: 14px;
            border-radius: 12px;
            font-size: 18px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 10px;
            transition: background 0.3s;
        }
        .btn:hover {
            background: #0062c4;
        }
        .result {
            margin-top: 30px;
            background: #f0f7ff;
            border-radius: 12px;
            padding: 20px;
            color: #333;
            font-size: 16px;
        }
        .logo {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            font-weight: 700;
            color: #0071e3;
            margin-bottom: 30px;
        }
        .logo i {
            margin-right: 10px;
        }
    </style>
</head>
<body>
    <div style="width:100%;background:linear-gradient(90deg,#0071e3 60%,#00c3a0 100%);padding:18px 0 10px 0;box-shadow:0 2px 12px rgba(0,113,227,0.08);">
        <div style="max-width:700px;margin:0 auto;display:flex;align-items:center;">
            <div style="display:flex;align-items:center;">
                <div style="width:48px;height:48px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;margin-right:16px;box-shadow:0 2px 8px rgba(0,113,227,0.10);">
                    <span style="font-size:28px;font-weight:bold;color:#0071e3;">育</span>
                </div>
                <span style="font-size:26px;font-weight:700;color:#fff;letter-spacing:2px;">育聘智联</span>
            </div>
            <span style="margin-left:32px;font-size:18px;color:#e0f7fa;font-weight:500;">创新招聘新体验</span>
        </div>
    </div>
    <div class="container">
        <h2>上传简历（支持PDF、Word、TXT等）</h2>
    <form method="post" enctype="multipart/form-data" action="{{ url_for('upload_resume') }}">
            <div class="form-group">
                <label for="resume">选择简历文件：</label>
                <input type="file" id="resume" name="resume" accept=".pdf,.doc,.docx,.txt" required>
            </div>
            <button type="submit" class="btn"><i class="fas fa-upload"></i> 上传并解析</button>
        </form>
        {% with messages = get_flashed_messages() %}
            {% if messages %}
                <div class="result">
                    {% for message in messages %}
                        <p>{{ message }}</p>
                    {% endfor %}
                </div>
            {% endif %}
        {% endwith %}
        {% if new_id %}
        <div class="result" style="margin-bottom:32px;">
            <strong>新简历ID：</strong> {{ new_id }}
        </div>
        <div style="text-align:center;margin-bottom:24px;">
            <a href="/" class="btn" style="display:inline-block;width:auto;padding:12px 40px;background:#339afc;">返回主页</a>
        </div>
    </div>
        {% endif %}
        {% if result %}
        <div class="result">
            <strong>解析结果：</strong>
            <pre>{{ result }}</pre>
        </div>
        {% endif %}
    </div>
</body>
</html>
